import api from "./api_base";

import { GpuType } from "./type";

// 获取GPU列表
export const getGpuList = (manufacturers: string) => {
  return api.get("/gpu/code", {
    params: {
      manufacturers,
    },
  });
};

//上传GPU信息
export const uploadGpuInfo = (data: GpuType) => {
  return api.post("/gpu/gpuinfo", data);
};

//获取GPU信息
export const getGpuInfo = (page: number, limit: number, data: any) => {
  return api.get("/gpu/gpuinfo", {
    params: {
      page,
      limit,
      ...data,
    },
  });
};

//通过ID更新GPU信息
export const updateGpuInfo = (id: string, data: GpuType) => {
  return api.post(`/gpu/gpuinfo/${id}`, data);
};

//删除GPU信息
export const deleteGpuInfo = (id: string) => {
  return api.post(`/gpu/gpuinfo/delete/${id}`);
};
